package com.qf.service.impl;

import com.qf.bo.RoleBO;
import com.qf.dao.RoleDao;
import com.qf.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

/**
 * @USER: Administrator
 * @DATE: 2025/9/6 下午9:16
 * @VERSION: 1.0.0
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleDao roleDao;

    @Override
    public List<RoleBO> queryAllRole() {
        return roleDao.queryAllRole();
    }

    @Override
    public Integer saveOrUpdate(RoleBO roleBO) {
        return Objects.isNull(roleBO.getId())?roleDao.insertRole(roleBO):roleDao.updateRole(roleBO);
    }

    @Override
    public Integer deleteRole(Long id) {
        return roleDao.deleteRole(id);
    }

}
